package com.liu.manager.mapper;

import com.liu.manager.entity.Syspermission;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface SyspermissionMapper {

    @Insert("insert into syspermission(permissionname,action,permissontype,create_time,update_time,status) values(#{permissionName},#{action},#{permissionType},#{createTime},#{updateTime},#{status})")
    @Options(useGeneratedKeys = true,keyProperty = "id",keyColumn = "id")
    int insertPermission(Syspermission syspermission);

    @Select("select * from syspermission")
    List<Syspermission> getAllPermissions();

    @Delete("delete from syspermission where id=#{id}")
    int deletePermission(long id);

    @Select("select * from syspermission where id=#{id}")
    Syspermission findById(long id);

}
